import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import AutoImport from "unplugin-auto-import/vite"
import DefineOptions from 'unplugin-vue-define-options/vite';
// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  // css: {
  //   preprocessorOptions: {
  //     scss: {
  //       additionalData: `@import '@/assets/style/base.scss';`
  //     }
  //   }
  // },
  plugins: [
      vue(),
      DefineOptions(),
      AutoImport ({
        imports: ["vue", "vue-router"], // 自动导入vue和vue-router相关函数
        dts: "src/auto-import.d.ts" // 生成 `auto-import.d.ts` 全局声明
      })
  ],
  server: {
    host: '127.0.0.1',
    port: 8090,
    proxy: {
      "/api": {
        target: "http://127.0.0.1:3030"
      }
    }
  }
})
